let obj = {
    name: 'admin',
    pwd: 123456,
    level: 10,
    age: 20
}


for (const key in obj) {
    console.log(key, obj[key])
}


class student {
    study() {
        console.log('我在学习')
    }
    sleep() {
        console.log('我在睡觉')
    }
}

let stu1 = new student();
let funcName = 'study';
stu1[funcName]()